<script>
export default {
  name: "News",
  data(){
    return{
      newsList:[
        {id:1001,title:'奥运金牌信息1'},
        {id:1002,title:'奥运金牌信息2'},
        {id:1003,title:'奥运金牌信息3'},
        {id:1004,title:'奥运金牌信息4'}
      ]
    }
  },
  methods:{
    toDetail(id){
      this.$router.push('/detail/'+id)
    }
  }
}
</script>

<template>
    <h3>新闻页面</h3>
    <ul>
      <li v-for="(news,index) in newsList" :key="index">
        <a href="javascript:void(0)" @click="toDetail(news.id)">--{{news.title}}--</a>
      </li>
    </ul>
</template>

<style scoped>

</style>